// pages/medicine/pages/choosePerson/choosePerson.js
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    specialService: [{
        id: 1,
        effect: 80,
        satisfied: 60,
        about: 200,
        title: '换骨头方案',
        img: 'https://www.webstrongtech.net/attachment/images/141/2018/10/P3tvt6biWt3w088R8CZ830638N4t83.png'
      },
      {
        id: 2,
        effect: 80,
        satisfied: 60,
        about: 200,
        title: '换骨头方案',
        img: 'https://www.webstrongtech.net/attachment/images/141/2018/10/P3tvt6biWt3w088R8CZ830638N4t83.png'
      },
      {
        id: 3,
        effect: 80,
        satisfied: 60,
        about: 200,
        title: '换骨头方案',
        img: 'https://www.webstrongtech.net/attachment/images/141/2018/10/P3tvt6biWt3w088R8CZ830638N4t83.png'
      },
      {
        id: 4,
        effect: 80,
        satisfied: 60,
        about: 200,
        title: '换骨头方案',
        img: 'https://www.webstrongtech.net/attachment/images/141/2018/10/P3tvt6biWt3w088R8CZ830638N4t83.png'
      },
      {
        id: 5,
        effect: 80,
        satisfied: 60,
        about: 200,
        title: '换骨头方案',
        img: 'https://www.webstrongtech.net/attachment/images/141/2018/10/P3tvt6biWt3w088R8CZ830638N4t83.png'
      }
    ],
  },
  commodity: function(e) {
    var that = this
    var zid = that.data.zid
    let sid = e.currentTarget.dataset.sid;
    wx.navigateTo({
      url: '/hyb_yl/backstageGroceries/pages/doctorIntro/doctorIntro?sid=' + sid + '&zid=' + zid
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    var that = this
    let title = options.title;
    var zid = options.zid
    if (title == '手术快约') {
      wx.setNavigationBarTitle({
        title: '手术快约'
      })
    }
    if (title == '专家坐诊') {
      wx.setNavigationBarTitle({
        title: '专家坐诊'
      })
    }
    if (title == '点名会诊') {
      wx.setNavigationBarTitle({
        title: '点名会诊'
      })
    }
    that.setData({
      title: title,
      zid: zid
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {
    this.getAllfuwulist()
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  getAllfuwulist: function() {
    var that = this
    var stype = that.data.title
    var zid = that.data.zid
    app.util.request({
      'url': 'entry/wxapp/Docfuwu',
      data: {
        stype: stype,
        zid: zid,
        op: 'display'
      },
      success: function(res) {
        console.log(res)
        that.setData({
          fuwu: res.data.data
        })
      }
    })
  }
})